<template>
  <div id="memos" class="container">
    <MemoItem v-for="item in fliterMemo()" :key="item.id" :memo="item"/>
  </div>
</template>

<script lang="ts">
  import {Component, Vue} from 'vue-property-decorator'
  import ItemDetail from "../model/ItemDetail";
  import MemoItem from "@/components/MemoItem.vue";
  
  @Component({
    components: {
      MemoItem
    }
  })
  
  export default class memoItemList extends Vue {
    memoArr: Array<ItemDetail> = this.$store.state.actHelp.memoList
    
    // 分类过滤笔记
    fliterMemo(): any {
      if (this.$store.state.filterCateId == -1) {
        return this.memoArr
      } else {
        return this.memoArr.filter((e: any) => e.categoryId == this.$store.state.filterCateId)
      }
    }
  }
</script>

<style scoped>

</style>
